import type {
  EntityApi,
  EntityReq,
  EntityModel,
  EntityList,
  EntityPage,
  EntityTotal,
  EntityKey,
  EntityKeyList,
  EntityCreateReq,
  EntityUpdateReq,
  EntityExportReq,
  EntityImportReq
} from "jmash-core";

//字典类型接口
export interface DictTypeApi extends EntityApi {

}

//字典类型查询
export interface DictTypeReq extends EntityReq {
  //字典类型编码
  typeCode?: string;
  //字典类型名称(模糊查询)
  likeTypeName?: string;
  //是否包含启用字段
  hasEnable?: boolean;
  //是否启用
  enable?: boolean;
  //是否包含数据字典类型
  hasEntryType?: boolean;
  //字典实体类型
  entryType?: string;
}

//字典类型实体
export interface DictTypeModel extends EntityModel {
  //字典类型编码
  typeCode?: string;
  //字典类型名称
  typeName?: string;
  //排序
  listOrder?: number;
  //是否启用
  enable?: boolean;
  //开放访问
  isOpen?:boolean;
  //字典实体类型
  entryType?: string;
  //描述
  description?: string;
}

//字典类型列表
export interface DictTypeList extends EntityList {
  //内容
  results: Array<DictTypeModel>;
}

// 字典类型分页
export interface DictTypePage extends EntityPage {
  //当前页内容
  results: Array<DictTypeModel>;
  //本页小计
  subTotalDto: DictTypeModelTotal;
  //合计
  totalDto: DictTypeModelTotal;
}

// 合计
export interface DictTypeModelTotal extends EntityTotal {
  //总记录数
  totalSize: number;
}

// 字典类型主键
export interface DictTypeKey extends EntityKey {
  // 租户
  tenant?: string;
  typeCode?: string;
}

//字典类型List
export interface DictTypeKeyList extends EntityKeyList {
  // 租户
  tenant?: string;
  typeCode?: Array<string>;
}

// 字典类型新增实体
export interface DictTypeCreateReq extends EntityCreateReq {
  //字典类型编码
  typeCode?: string;
  //字典类型名称
  typeName?: string;
  //排序
  listOrder?: number;
  //是否启用
  enable?: boolean;
  //字典实体类型
  entryType?: string;
  //开放访问
  isOpen?:boolean;
  //描述
  description?: string;
}

// 字典类型修改实体
export interface DictTypeUpdateReq extends EntityUpdateReq {
  //字典类型编码
  typeCode?: string;
  //字典类型名称
  typeName?: string;
  //排序
  listOrder?: number;
  //是否启用
  enable?: boolean;
  //开放访问
  isOpen?:boolean;
  //字典实体类型
  entryType?: string;
  //描述
  description?: string;
}

export type DictTypeFormReq = DictTypeCreateReq | DictTypeUpdateReq;

//导出请求
export interface DictTypeExportReq extends EntityExportReq{ 
  //筛选条件
  req: DictTypeReq;
}

//导入请求
export interface DictTypeImportReq extends EntityImportReq {

}

// 上移下移
export interface DictTypeMoveKey {
  // 租户
  tenant?: string;
  typeCode?: string;
  up?: boolean;
}

// 启用/禁用
export interface DictTypeEnableKey  {
  // 租户
  tenant?: string;
  typeCode?: string;
  enable?: boolean;
}
